{
	UCE - cross-platform game engine written in delphi.
	Copyright (c) 2009, Shutko Vitaly

	This file is part of UCE.

	UCE is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License as published by the Free Software Foundation; either
	version 2.1 of the License, or (at your option) any later version.

	UCE is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this library; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
}

unit uGfx;

interface

uses
  uTyp;

const
  GFX_LINES = 0;
  GFX_LINESTRIP = 1;
  GFX_TRIFAN = 2;

type
  PGfxVert = ^TGfxVert;
  TGfxVert = packed record
    x, y, z: Single;
    color: TClr;
    u, v: Single;
  end;

  TGfx = class
    function Init: Boolean; virtual; abstract;
    procedure SetCanvasSize; virtual; abstract;
    procedure BeginFrame; virtual; abstract;
    procedure EndFrame; virtual; abstract;
    procedure PushTrans; virtual; abstract;
    procedure PopTrans; virtual; abstract;
    procedure Trans(x, y: Single); virtual; abstract;
    procedure Rotate(angle: Single); virtual; abstract;
    procedure Scale(x, y: Single); virtual; abstract;
    procedure DrawPrim(type_, count: Integer; verts: Pointer); virtual; abstract;
    procedure NoTex; virtual; abstract;
  end;

function MakeGfxVert(x, y, u, v: Single; color: TClr): TGfxVert;

implementation

function MakeGfxVert(x, y, u, v: Single; color: TClr): TGfxVert;
begin
  Result.x := x;
  Result.y := y;
  Result.z := 0;
  Result.u := u;
  Result.v := v;
  Result.color := color;
end;

end.